package com.security.test.springsecuritydemo13.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * Created with IntelliJ IDEA.
 *
 * @author： liuziyang
 * @date： 2023/1/25-17:04
 * @description：
 * @modifiedBy：
 * @version: 1.0
 */
@Controller
public class MainController {
    private static final Logger LOGGER = LoggerFactory.getLogger(MainController.class);

    @GetMapping("/")
    public String main(OAuth2AuthenticationToken token) {
        LOGGER.info(String.valueOf(token.getPrincipal()));
        return "main.html";
    }
}
